package checkers3d.presentation;

import java.awt.Point;

/**
 * An interace for objects which manage a render window and system input. Allows
 * for drawing objects, which implement IDrawable or GUIContainer, to a
 * invisible buffer. Provides functions for clearing the invisible buffer or
 * copying its contents to the visible buffer. Captures input and redirects to
 * an IInputObserver given when this object is instanced.
 *
 * @author      Ruben Acuna
 */
public interface IInteractiveWindow
{
    /**
    * Draws a GUIContainer to the back buffer.
    */
    void draw(GUIContainer window);

    /**
    * Draws an IDrawable to the back buffer.
    *
    * @param  drawable An object that implements the IDrawable interface.
    */
    void draw(IDrawable drawable);

    /**
    * Copies the contents of the back buffer to the visible buffer.
    */
    void flushBackBuffer();

    /**
    * Prepares the back buffer for rendering a new frame.
    */
    void prepareBackBuffer();

    /**
     * Closes the window and stops directing input.
     */
    void shutdown();

    /**
    * Sets up up a render window with a given title and size, and attaches a
    * given object to events received from the window.
    *
    * @param  windowTitle   String to display in titlebar of window.
    * @param  windowSize    Size of window.
    * @param  userListener  Object that will listen to events received from the
    *                       window.
    */
    void start(String windowTitle, Point windowSize,
               IInputObserver userListener);
}